/*
 Navicat Premium Dump SQL

 Source Server         : 本地
 Source Server Type    : MySQL
 Source Server Version : 50744 (5.7.44)
 Source Host           : localhost:3306
 Source Schema         : nuxt-admin

 Target Server Type    : MySQL
 Target Server Version : 50744 (5.7.44)
 File Encoding         : 65001

 Date: 04/01/2025 13:15:09
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for _prisma_migrations
-- ----------------------------
DROP TABLE IF EXISTS `_prisma_migrations`;
CREATE TABLE `_prisma_migrations` (
  `id` varchar(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `checksum` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `finished_at` datetime(3) DEFAULT NULL,
  `migration_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `logs` text COLLATE utf8mb4_unicode_ci,
  `rolled_back_at` datetime(3) DEFAULT NULL,
  `started_at` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `applied_steps_count` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of _prisma_migrations
-- ----------------------------
BEGIN;
INSERT INTO `_prisma_migrations` (`id`, `checksum`, `finished_at`, `migration_name`, `logs`, `rolled_back_at`, `started_at`, `applied_steps_count`) VALUES ('082ae6ef-75a9-42b8-a077-9df0b25ca132', '91116a17b7e7ad2186230054afe5b2406fb7c34717d843463ef6040269345208', '2024-12-05 15:22:52.966', '20241205151928_init', NULL, NULL, '2024-12-05 15:22:52.947', 1);
INSERT INTO `_prisma_migrations` (`id`, `checksum`, `finished_at`, `migration_name`, `logs`, `rolled_back_at`, `started_at`, `applied_steps_count`) VALUES ('3c416770-399d-4429-8b40-0d1d1c931ad0', 'ae02264a10fe25bb4c9efb04ac7859a510a7ceca587fc518513080fb0d403669', '2024-12-17 11:44:28.681', '20241217114428_update', NULL, NULL, '2024-12-17 11:44:28.673', 1);
INSERT INTO `_prisma_migrations` (`id`, `checksum`, `finished_at`, `migration_name`, `logs`, `rolled_back_at`, `started_at`, `applied_steps_count`) VALUES ('a899cb62-653a-4be5-85e9-3d28bf8563cf', 'df51fd1b6e2fbc6242d2d4792e71a52e4428d3c8c2bc07bfbd4bff2df1c7beeb', '2024-12-05 15:22:52.946', '20241205151412_init', NULL, NULL, '2024-12-05 15:22:52.915', 1);
INSERT INTO `_prisma_migrations` (`id`, `checksum`, `finished_at`, `migration_name`, `logs`, `rolled_back_at`, `started_at`, `applied_steps_count`) VALUES ('b80e816d-fd33-465f-896d-bf73cd9d2145', '65d2a391e341bdc788f50ca9d533240ca5939ad8f5f528f487f909683e31eb87', '2024-12-18 10:58:12.593', '20241218105812_update', NULL, NULL, '2024-12-18 10:58:12.581', 1);
INSERT INTO `_prisma_migrations` (`id`, `checksum`, `finished_at`, `migration_name`, `logs`, `rolled_back_at`, `started_at`, `applied_steps_count`) VALUES ('e299fbfc-441b-424d-a317-b98704e52736', 'cb4530b0e96bc1f718653eed7a33fd907acec7278ef6011329f7ae8b738d67f7', '2024-12-05 15:22:52.915', '20241205144858_init', NULL, NULL, '2024-12-05 15:22:52.872', 1);
INSERT INTO `_prisma_migrations` (`id`, `checksum`, `finished_at`, `migration_name`, `logs`, `rolled_back_at`, `started_at`, `applied_steps_count`) VALUES ('e54f0af8-4db0-432f-8a53-2b3f70aaa1d8', '1407b88df652d873e7264bae4b34910a1fafe736e81198fc0d783f10ae19a18c', '2024-12-05 15:22:53.211', '20241205152253_init', NULL, NULL, '2024-12-05 15:22:53.180', 1);
COMMIT;

-- ----------------------------
-- Table structure for sys_dept
-- ----------------------------
DROP TABLE IF EXISTS `sys_dept`;
CREATE TABLE `sys_dept` (
  `deptId` int(11) NOT NULL AUTO_INCREMENT,
  `parentId` int(11) NOT NULL DEFAULT '0',
  `ancestors` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `deptName` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `orderNum` int(11) NOT NULL DEFAULT '0',
  `leader` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` char(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `delFlag` char(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `createBy` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `createTime` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updateBy` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `updateTime` datetime(3) NOT NULL,
  PRIMARY KEY (`deptId`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of sys_dept
-- ----------------------------
BEGIN;
INSERT INTO `sys_dept` (`deptId`, `parentId`, `ancestors`, `deptName`, `orderNum`, `leader`, `phone`, `email`, `status`, `delFlag`, `createBy`, `createTime`, `updateBy`, `updateTime`) VALUES (1, 0, '0', '集团公司(深圳)', 1, '张三', '18681496678', '123456789@qq.com', '1', '0', '', '2024-12-06 12:20:53.063', '', '2024-12-15 08:17:44.094');
INSERT INTO `sys_dept` (`deptId`, `parentId`, `ancestors`, `deptName`, `orderNum`, `leader`, `phone`, `email`, `status`, `delFlag`, `createBy`, `createTime`, `updateBy`, `updateTime`) VALUES (2, 1, '0,1', '长沙分公司', 1, 'test1', '18681496678', '844475003@qq.com', '1', '0', '', '2024-12-13 09:07:30.808', '', '2024-12-15 08:08:31.148');
INSERT INTO `sys_dept` (`deptId`, `parentId`, `ancestors`, `deptName`, `orderNum`, `leader`, `phone`, `email`, `status`, `delFlag`, `createBy`, `createTime`, `updateBy`, `updateTime`) VALUES (3, 2, '0,1,2', '研发部', 1, 'test', '18681496678', '844475003@qq.com', '1', '0', '', '2024-12-15 06:53:30.613', '', '2024-12-15 08:08:33.823');
COMMIT;

-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
  `menuId` int(11) NOT NULL AUTO_INCREMENT,
  `menuName` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `parentId` int(11) NOT NULL DEFAULT '0',
  `orderNum` int(11) NOT NULL DEFAULT '0',
  `url` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `target` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `menuType` char(1) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `visible` char(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `isRefresh` char(1) COLLATE utf8mb4_unicode_ci DEFAULT '1',
  `perms` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `icon` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `createBy` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `createTime` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updateBy` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `updateTime` datetime(3) NOT NULL,
  `remark` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `menuEnName` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`menuId`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of sys_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_menu` (`menuId`, `menuName`, `parentId`, `orderNum`, `url`, `target`, `menuType`, `visible`, `isRefresh`, `perms`, `icon`, `createBy`, `createTime`, `updateBy`, `updateTime`, `remark`, `menuEnName`) VALUES (1, '系统管理', 0, 0, '/system/user', '1', '1', '1', '1', NULL, 'setting', '', '2024-12-17 11:49:52.733', '', '2024-12-17 11:49:52.733', '', 'System Manage');
INSERT INTO `sys_menu` (`menuId`, `menuName`, `parentId`, `orderNum`, `url`, `target`, `menuType`, `visible`, `isRefresh`, `perms`, `icon`, `createBy`, `createTime`, `updateBy`, `updateTime`, `remark`, `menuEnName`) VALUES (2, '用户管理', 1, 0, '/system/user', '1', '1', '1', '1', NULL, 'user', '', '2024-12-17 11:51:45.569', '', '2024-12-17 11:51:45.569', '', 'User Management');
INSERT INTO `sys_menu` (`menuId`, `menuName`, `parentId`, `orderNum`, `url`, `target`, `menuType`, `visible`, `isRefresh`, `perms`, `icon`, `createBy`, `createTime`, `updateBy`, `updateTime`, `remark`, `menuEnName`) VALUES (3, '角色管理', 1, 0, '/system/role', '1', '1', '1', '1', NULL, 'team', '', '2024-12-17 12:26:36.629', '', '2024-12-17 12:26:44.641', '', 'Role Management');
INSERT INTO `sys_menu` (`menuId`, `menuName`, `parentId`, `orderNum`, `url`, `target`, `menuType`, `visible`, `isRefresh`, `perms`, `icon`, `createBy`, `createTime`, `updateBy`, `updateTime`, `remark`, `menuEnName`) VALUES (4, '菜单管理', 1, 0, '/system/menu', '1', '1', '1', '1', NULL, 'menu', '', '2024-12-17 12:28:21.331', '', '2024-12-17 12:28:21.331', '', 'Menu Management');
INSERT INTO `sys_menu` (`menuId`, `menuName`, `parentId`, `orderNum`, `url`, `target`, `menuType`, `visible`, `isRefresh`, `perms`, `icon`, `createBy`, `createTime`, `updateBy`, `updateTime`, `remark`, `menuEnName`) VALUES (5, '部门管理', 1, 0, '/system/dept', '1', '1', '1', '1', NULL, 'cluster', '', '2024-12-17 12:29:26.778', '', '2024-12-17 12:29:26.778', '', 'Department Management');
INSERT INTO `sys_menu` (`menuId`, `menuName`, `parentId`, `orderNum`, `url`, `target`, `menuType`, `visible`, `isRefresh`, `perms`, `icon`, `createBy`, `createTime`, `updateBy`, `updateTime`, `remark`, `menuEnName`) VALUES (6, '岗位管理', 1, 0, '/system/post', '1', '1', '1', '1', NULL, 'addteam', '', '2024-12-17 12:30:08.416', '', '2024-12-17 12:30:08.416', '', 'Post Management');
COMMIT;

-- ----------------------------
-- Table structure for sys_post
-- ----------------------------
DROP TABLE IF EXISTS `sys_post`;
CREATE TABLE `sys_post` (
  `postId` int(11) NOT NULL AUTO_INCREMENT,
  `postCode` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `postName` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `postSort` int(11) NOT NULL DEFAULT '0',
  `status` char(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `createBy` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `createTime` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updateBy` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `updateTime` datetime(3) NOT NULL,
  `remark` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`postId`),
  UNIQUE KEY `sys_post_postCode_key` (`postCode`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of sys_post
-- ----------------------------
BEGIN;
INSERT INTO `sys_post` (`postId`, `postCode`, `postName`, `postSort`, `status`, `createBy`, `createTime`, `updateBy`, `updateTime`, `remark`) VALUES (1, 'HR', 'HR', 1, '1', '', '2024-12-05 15:23:03.666', '', '2024-12-10 13:54:55.305', 'HR');
INSERT INTO `sys_post` (`postId`, `postCode`, `postName`, `postSort`, `status`, `createBy`, `createTime`, `updateBy`, `updateTime`, `remark`) VALUES (2, 'SEO', 'SEO', 1, '1', '', '2024-12-05 15:23:14.030', '', '2024-12-10 13:54:59.078', 'SEO');
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `roleId` int(11) NOT NULL AUTO_INCREMENT,
  `roleName` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `roleKey` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `roleSort` int(11) NOT NULL DEFAULT '0',
  `dataScope` char(1) COLLATE utf8mb4_unicode_ci DEFAULT '1',
  `status` char(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `delFlag` char(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `createBy` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `createTime` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updateBy` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `updateTime` datetime(3) NOT NULL,
  `remark` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`roleId`),
  UNIQUE KEY `sys_role_roleName_key` (`roleName`),
  UNIQUE KEY `sys_role_roleKey_key` (`roleKey`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` (`roleId`, `roleName`, `roleKey`, `roleSort`, `dataScope`, `status`, `delFlag`, `createBy`, `createTime`, `updateBy`, `updateTime`, `remark`) VALUES (1, '超级管理员', 'admin', 0, '1', '1', '0', '', '2024-12-06 14:29:55.782', '', '2024-12-18 12:56:00.065', '超级管理员');
INSERT INTO `sys_role` (`roleId`, `roleName`, `roleKey`, `roleSort`, `dataScope`, `status`, `delFlag`, `createBy`, `createTime`, `updateBy`, `updateTime`, `remark`) VALUES (2, 'test', 'test', 1, '1', '1', '0', '', '2024-12-13 07:37:56.566', '', '2024-12-18 12:56:39.721', 'test');
COMMIT;

-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
  `roleId` int(11) NOT NULL,
  `menuId` int(11) NOT NULL,
  PRIMARY KEY (`roleId`,`menuId`),
  CONSTRAINT `sys_role_menu_roleId_fkey` FOREIGN KEY (`roleId`) REFERENCES `sys_role` (`roleId`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of sys_role_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 1);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 2);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 3);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 4);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 5);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 6);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (2, 1);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (2, 2);
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `userId` int(11) NOT NULL AUTO_INCREMENT,
  `deptId` int(11) NOT NULL DEFAULT '0',
  `userName` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nickName` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `userType` char(2) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '00',
  `email` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phonenumber` varchar(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sex` char(1) COLLATE utf8mb4_unicode_ci DEFAULT '0',
  `avatar` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `password` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `salt` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` char(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `delFlag` char(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `loginIp` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `loginDate` datetime(3) DEFAULT NULL,
  `createBy` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `createTime` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updateBy` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `updateTime` datetime(3) NOT NULL,
  `remark` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`userId`),
  UNIQUE KEY `sys_user_userName_key` (`userName`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` (`userId`, `deptId`, `userName`, `nickName`, `userType`, `email`, `phonenumber`, `sex`, `avatar`, `password`, `salt`, `status`, `delFlag`, `loginIp`, `loginDate`, `createBy`, `createTime`, `updateBy`, `updateTime`, `remark`) VALUES (1, 0, 'admin', '管理员', '00', NULL, '1868149678', '0', '/favicon.ico', '0c12SFIVkwIqOxFuvFa8Xw==', NULL, '1', '0', NULL, NULL, '', '2024-12-08 15:23:30.862', '', '2024-12-08 15:23:30.862', NULL);
INSERT INTO `sys_user` (`userId`, `deptId`, `userName`, `nickName`, `userType`, `email`, `phonenumber`, `sex`, `avatar`, `password`, `salt`, `status`, `delFlag`, `loginIp`, `loginDate`, `createBy`, `createTime`, `updateBy`, `updateTime`, `remark`) VALUES (4, 1, 'test', 'test', '00', '844475003@qq.com', '18681496678', '1', '/favicon.ico', 'lEdTuauaHjCz+vaGNXwArQ==', NULL, '1', '0', NULL, NULL, '', '2024-12-10 09:23:20.566', '', '2024-12-19 02:48:01.979', NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_user_post
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_post`;
CREATE TABLE `sys_user_post` (
  `userId` int(11) NOT NULL,
  `postId` int(11) NOT NULL,
  PRIMARY KEY (`userId`,`postId`),
  CONSTRAINT `sys_user_post_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `sys_user` (`userId`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of sys_user_post
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_post` (`userId`, `postId`) VALUES (1, 1);
INSERT INTO `sys_user_post` (`userId`, `postId`) VALUES (1, 2);
INSERT INTO `sys_user_post` (`userId`, `postId`) VALUES (4, 1);
INSERT INTO `sys_user_post` (`userId`, `postId`) VALUES (4, 2);
COMMIT;

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
  `userId` int(11) NOT NULL,
  `roleId` int(11) NOT NULL,
  PRIMARY KEY (`userId`,`roleId`),
  CONSTRAINT `sys_user_role_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `sys_user` (`userId`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_role` (`userId`, `roleId`) VALUES (1, 1);
INSERT INTO `sys_user_role` (`userId`, `roleId`) VALUES (4, 2);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
